<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backTo()"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">覆约</view>
		</view>	
		<view class="bg_box">
			<image class="bg01" src="/static/bg05.png" mode="widthFix"></image>
			<view class="bg_content">
				
				<view class="appoint_box">
					<view class="appoint_text">
						<view class="text_box">
							<view class="title">今日应覆约(元)</view>
							<view class="num">{{info.total_money}}</view>
							<view class="text">年利率:{{info.order.cur_rate-0}}%,注意逾期产生罚息，请尽快还款</view>
						</view>
					</view>
				</view>
				
				<view class="records_maxbox">
					<view class="records_bg"></view>
					<view class="records_box">
						<view class="records_menu">
							<view class="menu" :class="select == 0 ? 'menucolor' : ''">计算金额</view>				
						</view>
							<view class="records_list">
								<view class="text_box">
									<view class="title">
										<view class="name">覆月本金</view>
									</view>
								</view>
								<view class="text_box">
									<view class="money">￥{{info.total_principal}}</view>
								</view>
							</view>
							<view class="records_list">
								<view class="text_box">
									<view class="title">
										<view class="name">应覆利息</view>
									</view>
								</view>
								<view class="text_box">
									<view class="money">￥{{info.total_interest}}</view>
								</view>
							</view>
							<view class="records_list">
								<view class="text_box">
									<view class="title">
										<view class="name">逾期罚息</view>
									</view>
								</view>
								<view class="text_box">
									<view class="money">￥{{info.total_expire_money}}</view>
								</view>
							</view>
							<view class="records_list">
								<view class="text_box">
									<view class="title">
										<view class="name">还款方式</view>
									</view>
								</view>
								<view class="text_box">
									<view class="money" v-if="info.order.rate_type == 0">等额本息</view>
									<view class="money" v-else >等额本金</view>
								</view>
							</view>
							
					</view>
				</view>
				
				
				
			</view>
		</view>
		
		<view class="confirm sub" :data-url="'/pages/personalcenter/appoint/square'" @click="to_model_sign">确认覆约 ￥{{info.total_money}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id : 0,
				page:1,
				scrrol:false,
				info:{
					order : {},
					total_money : 0,
					total_principal : 0,
					total_interest : 0,
					total_expire_money : 0
				},
				select:0,
				
				
			}
		},
		onLoad(opt) {
			this.id = opt.id || 0;
            this.initData();
		},
		methods: {
			to_model_sign(){
				
				let msg = '经理名称:'+this.info.order.agent_name+',电话:'+this.info.order.agent_phone;
				uni.showModal({
					title: '联系银行',
					content: msg,
					showCancel : false,
					success: function (res) {
						// if (res.confirm) {
						// 	console.log('用户点击确定');
						// } else if (res.cancel) {
						// 	console.log('用户点击取消');
						// }
					}
				});
				
			},
			setRule(e){
				let that = this;
				let index = e.currentTarget.dataset.index;
				that.flowList[index].tick = !that.flowList[index].tick
			},
			initData() {
		        let url = this.site_url + 'api/auth/loans/loans_sign_detail?id='+this.id;
				this.areq(url).then(res=>{
					if(res.code == 1){
						this.info = res.data;
					}
					
				})
		
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				this.$r(url);
			},

		},
		onPageScroll: function(Object) {
			if (Object.scrollTop > 28) {
				this.scrrol = true;
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;

			}
		},
	
	}
</script>

<style>
	
	.header{
		background-color: transparent !important;
	}
	
	.header .text{
		background-color: transparent !important;
		color: #333 !important;
	}
	
	.scrrolHeader{
		background-color: #F9E9E3 !important;
	}
	
	.bg_box{
		width: 100%;
		position: relative;
	}
	
	.bg_box .bg01{
		width: 100%;
	}
	
	.bg_box .bg_content{
		width: 92%;
		position: absolute;
		left: calc(50% - 46%);
		top: calc(13.5vw + var(--status-bar-height));
		z-index: 98;
	}
	
	.appoint_box{
		width: 100%;
		background-color: #fff;
		border-radius: 3vw;
	}
	
	.appoint_box .appoint_text{
		width: 100%;
		padding: 6vw 5vw;
		display: flex;
		align-items: center;
	}
	
	.appoint_box .appoint_text .text_box{
		flex: 1;
	}
	
	.appoint_box .appoint_text .menu{
		width: 24vw;
		height: 10vw;
		line-height: 10vw;
		border-radius: 10vw;
		text-align: center;
		line-height: 10vw;
		font-size: 3.5vw;
		background-color: #fff;
		color: #FA6E0C;
	}
	
	.appoint_box .appoint_text .icon{
		font-size: 20vw;
		color: #D1D1D1;
	}
	
	.appoint_box .appoint_text .text_box .title{
		font-size: 3.5vw;
		color: #333;
	}
	
	.appoint_box .appoint_text .text_box .num{
		font-size: 7.5vw;
		color: #333;
		font-weight: bold;
		margin-top: 2vw;
	}
	
	.appoint_box .appoint_text .text_box .text{
		font-size: 3.5vw;
		color: #FC5D20;
		margin-top: 2vw;
	}
	
	.records_maxbox{
		width: 100%;
		margin-top: 4%;
		position: relative;
	}
	
	.records_maxbox .records_bg{
		width: 104%;
		position: absolute;
		top: 0;
		left: -2%;
		background-color: #FBB89D;
		height: 4vw;
		border-radius: 4vw;
	}
	
	.records_box{
		width: 100%;	
		background-color: #fff;
		padding: 0 4vw 4vw;
		border-radius: 0 0 3vw 3vw;
		position: absolute;
		left: 0;
		top: 2vw;
		z-index: 98;
	}
	
	.records_menu{
		width: 100%;
		display: flex;
		align-items: center;
		height: 13vw;
		border-bottom: 1px solid #E0E4EC;
	}
	
	.records_menu .menu{
		width: 18vw;		
		height: 100%;
		line-height: 13vw;
		margin-right: 5vw;
		font-size: 4vw;
		color: #666666;
		text-align: center;
	}
	
	.menucolor{
		color: #333 !important;
		font-weight: bold;
		border-bottom: 3px solid #FC5D20;
	}
	
	.records_list{
		width: 100%;
		margin-top: 4%;
		display: flex;
		align-items: center;
	}
	
	.records_list .text_box{
		
	}
	
	.records_list .text_box:nth-child(1){
		flex: 0.6;
	}
	
	.records_list .text_box:nth-child(2){
		flex: 0.4;
	}
	
	.records_list .text_box .title{		
		display: flex;
		align-items: center;
	}
	
	.records_list .text_box .title .name{
		font-size: 4vw;
		color: #333;
		font-weight: bold;
	}
	
	.records_list .text_box .title .tag{
		font-size: 3vw;
		color: #B5B5B5;
		background-color: #F4F5F7;
		height: 5vw;
		padding: 0 1vw;
		border-radius: 1vw;
		display: flex;
		align-items: center;
		margin-left: 2vw;
	}
	
	.records_list .text_box .title .tag02{
		font-size: 3vw;
		color: #FC5D20;
		background-color: #FFF7F4;
		height: 5vw;
		padding: 0 1vw;
		border-radius: 1vw;
		display: flex;
		align-items: center;
		margin-left: 2vw;
	}
	
	.records_list .text_box .title .tag03{
		font-size: 3vw;
		color: #FF0005;
		background-color: #FFF2F2;
		height: 5vw;
		padding: 0 1vw;
		border-radius: 1vw;
		display: flex;
		align-items: center;
		margin-left: 2vw;
	}
	
	.records_list .text_box .time{
		font-size: 3.5vw;
		color: #999999;
		margin-top: 2vw;
	}
	
	.records_list .text_box .money{
		font-size: 3.8vw;
		color: #333;
		font-weight: bold;
		text-align: right;
	}
	
	.records_list .text_box .text{
		font-size: 3.5vw;
		color: #999999;
		margin-top: 2vw;
		text-align: right;
	}
	
	
	
	
</style>
